package com.gitee.wsl.transform.compress

interface Compress<A,B>{
    fun compress(a: A): B

    fun decompress(a: B): A

    companion object
}

typealias StringCompress = Compress<String, String>

typealias ByteArrayCompress = Compress<ByteArray, ByteArray>

fun <T> String.compress(type:Compress<String,T>) = type.compress(this)

fun <T> ByteArray.compress(type:Compress<ByteArray,T>) = type.compress(this)